﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace graphicsdemo
{
    public class Square:Graphics
    {
        private double l;

        public double L { get => l; set => l = value; }

        public Square(double l)
        {
            L = l;
        }
        public override bool IfEffect()
        {
            if(l <= 0)
                return false;
            else
                return true;
        }
        public override double GetArea()
        {
            if (IfEffect())
                return L * L;
            else
                return 0;
        }
        public override void Show()
        {
            Console.WriteLine("这个形状是正方形，面积为" + GetArea());
        }
    }
}
